<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: jetson-utils/filesystem.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('filesystem_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">filesystem.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;string&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
</div>
<p><a href="filesystem_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gad1f15dffa07492b842b0446759083939"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#gad1f15dffa07492b842b0446759083939">fileTypes</a> { <br />
&#160;&#160;<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939a674ed0f47143f80c97b188885d263fe7">FILE_MISSING</a> = 0, 
<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939aa2a2d933a005816134ee11ad33143366">FILE_REGULAR</a> = (1 &lt;&lt; 0), 
<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939a02f0758cc0104382b56cf6409c5c5c0a">FILE_DIR</a> = (1 &lt;&lt; 1), 
<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939aacbb267698a21335b5eb936fd0959c43">FILE_LINK</a> = (1 &lt;&lt; 2), 
<br />
&#160;&#160;<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939a9639392635f5f22fbc6cc8009045c980">FILE_CHAR</a> = (1 &lt;&lt; 3), 
<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939a3ed1a948b86ee98aebc19b81bdbde831">FILE_BLOCK</a> = (1 &lt;&lt; 4), 
<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939a57ca535dc6f0b553f54667617f2f6095">FILE_FIFO</a> = (1 &lt;&lt; 5), 
<a class="el" href="group__filesystem.html#ggad1f15dffa07492b842b0446759083939ac0a81bd8bc6a17f93b3cce7522793d8c">FILE_SOCKET</a> = (1 &lt;&lt; 6)
<br />
 }</td></tr>
<tr class="memdesc:gad1f15dffa07492b842b0446759083939"><td class="mdescLeft">&#160;</td><td class="mdescRight">File types.  <a href="group__filesystem.html#gad1f15dffa07492b842b0446759083939">More...</a><br /></td></tr>
<tr class="separator:gad1f15dffa07492b842b0446759083939"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2cc7cb09746b8181f3389dfee1113f78"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga2cc7cb09746b8181f3389dfee1113f78">absolutePath</a> (const std::string &amp;relative_path)</td></tr>
<tr class="memdesc:ga2cc7cb09746b8181f3389dfee1113f78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given a relative path, resolve the absolute path using the working directory.  <a href="group__filesystem.html#ga2cc7cb09746b8181f3389dfee1113f78">More...</a><br /></td></tr>
<tr class="separator:ga2cc7cb09746b8181f3389dfee1113f78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga09605d11f78fcd2d936793371d1c2ccc"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga09605d11f78fcd2d936793371d1c2ccc">locateFile</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:ga09605d11f78fcd2d936793371d1c2ccc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Locate a file from common system locations.  <a href="group__filesystem.html#ga09605d11f78fcd2d936793371d1c2ccc">More...</a><br /></td></tr>
<tr class="separator:ga09605d11f78fcd2d936793371d1c2ccc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0209cabb0f62f9cfec99a763b5a0bbd1"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga0209cabb0f62f9cfec99a763b5a0bbd1">locateFile</a> (const std::string &amp;path, std::vector&lt; std::string &gt; &amp;locations)</td></tr>
<tr class="memdesc:ga0209cabb0f62f9cfec99a763b5a0bbd1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Locate a file from a set of locations provided by the user, in addition to common system locations such as "/opt" and "/usr/local".  <a href="group__filesystem.html#ga0209cabb0f62f9cfec99a763b5a0bbd1">More...</a><br /></td></tr>
<tr class="separator:ga0209cabb0f62f9cfec99a763b5a0bbd1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9161593ad3336650b604b9b7ceb15b81"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga9161593ad3336650b604b9b7ceb15b81">readFile</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:ga9161593ad3336650b604b9b7ceb15b81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a text file into a string.  <a href="group__filesystem.html#ga9161593ad3336650b604b9b7ceb15b81">More...</a><br /></td></tr>
<tr class="separator:ga9161593ad3336650b604b9b7ceb15b81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51f3dc6065231b5ecde30f7e3f18f918"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga51f3dc6065231b5ecde30f7e3f18f918">pathJoin</a> (const std::string &amp;a, const std::string &amp;b)</td></tr>
<tr class="memdesc:ga51f3dc6065231b5ecde30f7e3f18f918"><td class="mdescLeft">&#160;</td><td class="mdescRight">Join two paths, and properly include a path separator (<code>/</code>) as needed.  <a href="group__filesystem.html#ga51f3dc6065231b5ecde30f7e3f18f918">More...</a><br /></td></tr>
<tr class="separator:ga51f3dc6065231b5ecde30f7e3f18f918"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga54a247d108dcb744e97b74cfb2c8cbdf"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga54a247d108dcb744e97b74cfb2c8cbdf">pathDir</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:ga54a247d108dcb744e97b74cfb2c8cbdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the parent directory of the specified path, removing the filename and extension.  <a href="group__filesystem.html#ga54a247d108dcb744e97b74cfb2c8cbdf">More...</a><br /></td></tr>
<tr class="separator:ga54a247d108dcb744e97b74cfb2c8cbdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad5cfaa7262a96cffe8e5427f9a2b2a7e"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#gad5cfaa7262a96cffe8e5427f9a2b2a7e">pathFilename</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:gad5cfaa7262a96cffe8e5427f9a2b2a7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the filename from the path, including the file extension.  <a href="group__filesystem.html#gad5cfaa7262a96cffe8e5427f9a2b2a7e">More...</a><br /></td></tr>
<tr class="separator:gad5cfaa7262a96cffe8e5427f9a2b2a7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1d7e3acbcab579b39a83ca97d7f7d519"><td class="memItemLeft" align="right" valign="top">std::pair&lt; std::string, std::string &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga1d7e3acbcab579b39a83ca97d7f7d519">splitPath</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:ga1d7e3acbcab579b39a83ca97d7f7d519"><td class="mdescLeft">&#160;</td><td class="mdescRight">Split a path into directory and filename components.  <a href="group__filesystem.html#ga1d7e3acbcab579b39a83ca97d7f7d519">More...</a><br /></td></tr>
<tr class="separator:ga1d7e3acbcab579b39a83ca97d7f7d519"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafccdab42bbe88448a26f3485e04cd6f2"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#gafccdab42bbe88448a26f3485e04cd6f2">listDir</a> (const std::string &amp;path, std::vector&lt; std::string &gt; &amp;list, uint32_t mask=0)</td></tr>
<tr class="memdesc:gafccdab42bbe88448a26f3485e04cd6f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a sorted list of the files in the specified directory.  <a href="group__filesystem.html#gafccdab42bbe88448a26f3485e04cd6f2">More...</a><br /></td></tr>
<tr class="separator:gafccdab42bbe88448a26f3485e04cd6f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga70cae24b8865ece1b2dbc16cbbcfe700"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga70cae24b8865ece1b2dbc16cbbcfe700">fileExists</a> (const std::string &amp;path, uint32_t mask=0)</td></tr>
<tr class="memdesc:ga70cae24b8865ece1b2dbc16cbbcfe700"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the directory /** Verify path and return true if the file exists.  <a href="group__filesystem.html#ga70cae24b8865ece1b2dbc16cbbcfe700">More...</a><br /></td></tr>
<tr class="separator:ga70cae24b8865ece1b2dbc16cbbcfe700"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2fae54af76a7a9056e1589b8b25bcc1a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga2fae54af76a7a9056e1589b8b25bcc1a">fileIsType</a> (const std::string &amp;path, uint32_t mask)</td></tr>
<tr class="memdesc:ga2fae54af76a7a9056e1589b8b25bcc1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the file is one of the types in the fileTypes mask.  <a href="group__filesystem.html#ga2fae54af76a7a9056e1589b8b25bcc1a">More...</a><br /></td></tr>
<tr class="separator:ga2fae54af76a7a9056e1589b8b25bcc1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5b9080296348ef2841dcd4c690c59001"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga5b9080296348ef2841dcd4c690c59001">fileType</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:ga5b9080296348ef2841dcd4c690c59001"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the file type, or FILE_MISSING if it doesn't exist.  <a href="group__filesystem.html#ga5b9080296348ef2841dcd4c690c59001">More...</a><br /></td></tr>
<tr class="separator:ga5b9080296348ef2841dcd4c690c59001"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga300756f37fbacd5c996a384d698a151f"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga300756f37fbacd5c996a384d698a151f">fileSize</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:ga300756f37fbacd5c996a384d698a151f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the size (in bytes) of the specified file.  <a href="group__filesystem.html#ga300756f37fbacd5c996a384d698a151f">More...</a><br /></td></tr>
<tr class="separator:ga300756f37fbacd5c996a384d698a151f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45ff5e488382fe54d24f27d340fcb5d2"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga45ff5e488382fe54d24f27d340fcb5d2">fileExtension</a> (const std::string &amp;path)</td></tr>
<tr class="memdesc:ga45ff5e488382fe54d24f27d340fcb5d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract the file extension from the path.  <a href="group__filesystem.html#ga45ff5e488382fe54d24f27d340fcb5d2">More...</a><br /></td></tr>
<tr class="separator:ga45ff5e488382fe54d24f27d340fcb5d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd437b0bcd116aa71e6ef6e49be351f1"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#gabd437b0bcd116aa71e6ef6e49be351f1">fileHasExtension</a> (const std::string &amp;path, const std::string &amp;extension)</td></tr>
<tr class="memdesc:gabd437b0bcd116aa71e6ef6e49be351f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the file has the given extension, otherwise false.  <a href="group__filesystem.html#gabd437b0bcd116aa71e6ef6e49be351f1">More...</a><br /></td></tr>
<tr class="separator:gabd437b0bcd116aa71e6ef6e49be351f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafc84dff3ce2435020bf2bcd4c02edda7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#gafc84dff3ce2435020bf2bcd4c02edda7">fileHasExtension</a> (const std::string &amp;path, const std::vector&lt; std::string &gt; &amp;extensions)</td></tr>
<tr class="memdesc:gafc84dff3ce2435020bf2bcd4c02edda7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the file has one of the given extensions, otherwise false.  <a href="group__filesystem.html#gafc84dff3ce2435020bf2bcd4c02edda7">More...</a><br /></td></tr>
<tr class="separator:gafc84dff3ce2435020bf2bcd4c02edda7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga684efd9f7360be64d2f0601c47552870"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#ga684efd9f7360be64d2f0601c47552870">fileHasExtension</a> (const std::string &amp;path, const char **extensions)</td></tr>
<tr class="memdesc:ga684efd9f7360be64d2f0601c47552870"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return true if the file has one of the given extensions, otherwise false.  <a href="group__filesystem.html#ga684efd9f7360be64d2f0601c47552870">More...</a><br /></td></tr>
<tr class="separator:ga684efd9f7360be64d2f0601c47552870"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaad68e41c1ebdc261ba49694e18eb8d15"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#gaad68e41c1ebdc261ba49694e18eb8d15">fileRemoveExtension</a> (const std::string &amp;filename)</td></tr>
<tr class="memdesc:gaad68e41c1ebdc261ba49694e18eb8d15"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the input string with the file extension removed For example, <code>fileRemoveExtension("~/workspace/somefile.xml")</code> would return <code>~/user/somefile</code>.  <a href="group__filesystem.html#gaad68e41c1ebdc261ba49694e18eb8d15">More...</a><br /></td></tr>
<tr class="separator:gaad68e41c1ebdc261ba49694e18eb8d15"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac5d5187920a9c4e1743dbd0b57ea8294"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__filesystem.html#gac5d5187920a9c4e1743dbd0b57ea8294">fileChangeExtension</a> (const std::string &amp;filename, const std::string &amp;newExtension)</td></tr>
<tr class="memdesc:gac5d5187920a9c4e1743dbd0b57ea8294"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the input string with a changed file extension For example, <code>fileChangeExtension("~/workspace/somefile.xml", "zip")</code> would return <code>~/user/somefile.zip</code>.  <a href="group__filesystem.html#gac5d5187920a9c4e1743dbd0b57ea8294">More...</a><br /></td></tr>
<tr class="separator:gac5d5187920a9c4e1743dbd0b57ea8294"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_54a0acf6da04fe2ed9410b4c6369bc5d.html">jetson-utils</a></li><li class="navelem"><a class="el" href="filesystem_8h.html">filesystem.h</a></li>
    <li class="footer">Generated on Tue Mar 28 2023 14:27:58 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
